<?php
include("sqlconnect.php");

session_start(); 
$prod=$_POST['cat'];
echo "$prod";

$query="SELECT product_id FROM product WHERE product_name='$prod'";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while($i<$num)
	{

	$field3=mysql_result($result,$i,"product_id");
	echo "$field3";
	$i++;
	}
	$_SESSION['num1']=$field3;
/*
$query=("INSERT INTO category_list(category_name) VALUES('$ccategory')");
mysql_query($query) or die("error in inserting");
$query1=("INSERT INTO top_category_list(category_name) VALUES('$ccategory')");
mysql_query($query1) or die("error in inserting");
*/
header('Location: vendor_tab2.php');

?>